﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace winApp2
{
    class UITools
    {
        public static void Msg(string msg)
        {
            MessageBox.Show(msg, "Haha数据管理工具", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public static void WriteReg(string k, string v)
        {
            var reg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("hahaMakeCode");
            reg.SetValue(k, v);
        }

        public static String ReadReg(string k, string vd = "")
        {
            var reg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("hahaMakeCode");
            var obj = reg.GetValue(k);
            if (obj == null) return vd;
            return obj.ToString();
        }
    }
}
